/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package modele;

import java.util.Collection;

/**
 *
 * @author sio
 */
public class Pays {
    
    //proprietes
    
    private Collection <Dep> lesDeps;
    private Collection <Spe> lesSpes;
    
    
    //methodes
    
    public Pays(){
        lesDeps = PaysDAO.getLesDeps();
        lesSpes = PaysDAO.getLesSpes();
    }
    
    public Collection <Dep> getLesDeps(){
        return lesDeps;
    }
    
    public Dep getLeDep(String numDep){
        for(Dep unDep:lesDeps){
            if (numDep.equals(unDep.getNum()))
                return unDep;
        }
        return null;
    }

    public Object getLesSpes() {
        return lesSpes;
    }

    public Spe getLaSpe(String choixSpe) {
        
        for(Spe uneSpe : lesSpes){
            if (choixSpe.equals(uneSpe.getNom())){
                return uneSpe;
            }
        }
        return null;
    }
}